<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->systemName;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
</head>

<body>
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：批量设置产品菜单 &gt; <a href="<?php echo $this->projectUrl(array('action'=>'batch-set'));?>">选择菜单</a> &gt; <span id="focus">选择产品</span></div>
			<div id="topOtherMenu">
				
			</div>
		</div>
		<div id="body">
			<div id="content">

				<form id="listForm" name="listForm" method="post" action="<?php echo $this->projectUrl(array('action'=>'batch-set-save'));?>">
					<table class="table">
						<tr>
							<td><b>已选择的菜单：</b></td>
						</tr>
<?php
echo $this->listContent;
?>

						<tr>
							<td><b>选择产品：</b></td>
						</tr>
						<tr>
							<td>
<?php
foreach ($this->productRows as $productRow) {
?>
								<div style="float:left; width:100px;">
									<label>
										<input type="checkbox" name="productCode[]" id="productCode[]" class="productCode" value="<?php echo $productRow['code'];?>" />
										<?php echo $productRow['name'];?>
									</label>
								</div>
<?php
}
?>
								<div style="float:left; width:100px;">
									<label>
										<a href="javascript:void(0);" onclick="$('.productCode').attr('checked', true);">全选</a>
										<a href="javascript:void(0);" onclick="$('.productCode').attr('checked', false);">取消</a>
									</label>
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<b>选择操作：</b>
							</td>
						</tr>
						<tr>
							<td>
								<label><input type="radio" name="updateOption" id="updateOption" value="delete" /> 删除</label>
								<label><input type="radio" name="updateOption" id="updateOption2" value="insert" /> 添加</label>
							</td>
						</tr>
						<tr>
							<td><input type="submit" name="button" id="button" value="提交" class="button" /></td>
						</tr>
					</table>

				</form>
			</div>
		</div>
</div>
<script language="javascript">
$("#listForm").submit(function(){
	if ($("input[name=productCode[]]:checked").size() == 0) {
		alert('请至少选择一个产品。');
		return false;
	}
	if ($("input[name=updateOption]:checked").size() == 0) {
		alert('请选择操作。');
		return false;
	}
});
</script>
</body>
</html>